/*
 * SimpleCommand.h
 *
 *  Created on: Jul 5, 2012
 *      Author: s131705
 */

#ifndef SIMPLECOMMAND_H_
#define SIMPLECOMMAND_H_

#include <string>
#include <vector>
#include <iostream>
using namespace std;

class Command
{
private:
	string name;
	vector<string> *arguments;

	string infile;
	string outfile;
	bool append;
public:
	Command();
	virtual ~Command();

	void setName(string n);
	string getName(){ return name; };
	void addArgument( string arg );
	vector<string>* getArguments();

	void setStdInput( string in );
	void setStdOutput( string out );

	void setIORedirectionInput( string in ){ infile = in; };
	string getIORedirectionInput(){ return infile; };
	void setIORedirectionOutput( string out ){ outfile = out; };
	string getIORedirectionOutput(){ return outfile; };
	void setAppend( bool app ){ this->append = app; };
	bool getAppend(){ return append; };
	string toString();
	bool isExitCommand(){ return (name == "logout" || name == "exit");}

	void print();
};

#endif /* SIMPLECOMMAND_H_ */
